util.spec.js ➔ ... ➔ ???   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
nc 1
dl 0
loc 7
rs 9.4285
nop 2
1
import test from 'ava';
2
import { flattenRoutes } from '../../src/parsers/util';
3
4
import { initialRoutes, expectedRoutes } from '../mock/routes';
5
6
test('flattenRoutes', t => {
7
    const flatRoutes = flattenRoutes(initialRoutes);
8
9
    flatRoutes.map( (flatRoute, index) => {
10
        t.deepEqual(
11
            flatRoutes[index],
12
            expectedRoutes[index],
13
            `should work for route with id ${expectedRoutes[index].id}`
14
        );
15
    })
16
17
});